<extend name="common:commonNewerTemplate" />
<block name="main_content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="index.html"
				data-original-title="Go to Home"><i class="icon-home"></i> 首页</a> <a
				href="#">四川电信渠道经销商</a> <a class="current" href="#">四川电信渠道经销商充值申请</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-info-sign"></i>
						</span>
						<h5>四川电信渠道经销商充值申请</h5>
					</div>
					<div class="widget-content nopadding">
						<form novalidate="novalidate" id="basic_validate"
							name="basic_validate" enctype="multipart/form-data" action="dealerAmountApplyAction" method="post"
							class="form-horizontal">
							
							<div class="control-group">
								<label class="control-label">经销商编号:</label>
								<div class="controls">
									<input type="text" id="dealer_id" name="dealer_id" value="{$dealer_en.dealer_id}" readonly="readonly"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">经销商名称:</label>
								<div class="controls">
									<input type="text" id="dealer_name" name="dealer_name" value="{$dealer_en.dealer_name}" readonly="readonly"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">变更种类:</label>
								<div class="controls">
									<select style="width:220px;" name="amount_kind" id="amount_kind">
					                  <option value="1" selected="selected">增加</option>
					                </select>
								</div>
							</div>	
							<div class="control-group">
								<label class="control-label">变更类型：</label>
								<div class="controls">
								<select id="amount_type" name="amount_type" style="width:220px;" >										
									<option value="13" selected="selected">充值</option>						
								</select>
								</div>
							</div>	
								
							<div class="control-group">
								<label class="control-label">金额:</label>
								<div class="controls">
									<input type="text" id="amount" name="amount" placeholder="请输入大于0的金额"/><span style="color:red;">*</span>
								</div>
							 </div>
							 
							 
							
							 <div class="control-group">
								<label class="control-label">凭证上传:</label>
								<div class="controls">
									<input type="file" id="identify_image" name="identify_image" accept="image/gif,image/jpeg,image/png,image/jpg"/><span style="color:red;">*</span>
								</div>
							 </div>
							 
							
							<div class="control-group">
								<label class="control-label">备注:</label>
								<div class="controls">
									<input type="text" id="remark" name="remark"/>
								</div>
							</div>
							
							<div class="control-group">
								<a id="btn_applyAmount" class="btn btn-success">申请</a> 
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</block>


<block name="js_content">
 <script>
		//新增页面资源管理
		$('#btn_applyAmount').bind('click', function(){
			
			var amount = $('#amount').val();
        	if(amount ==''){
        		
        		alert("金额不能为空!");
        		return;
        	}
        	if(isNaN(amount)){
        		alert("请输入一个正确金额!");
        		return;
        	}
        	
        	if(parseFloat(amount)<=0){
        		alert("请输入一个大于零的金额!");
        		return;
        	}
			var condition = $('#basic_validate').serialize();
			
			
			 $.ajax({
	                type: 'post',
	                url: '/AjaxService/center/dealer/validateDealerAmountApply',
	                data: condition,
	                dataType: 'json',
	                async: false,
	                success: function (data) {
	                    if (data.IsSuccess == 0) {
	                        alert(data.ErrorMsg);
	                        return;
	                    } else {
	                       $('#basic_validate').submit();
	                       //alert("Finished");
	                    }
	                },
	                error: function (e, err_name, err_text) {

	                }
	            });
			
			
			
		});
		
      
		
$(document).ready(function () {
    CommonPage.InitRegion();
});
</script> </block>